home *** CD-ROM | disk | FTP | other *** search
/ Danny Amor's Online Library / Danny Amor's Online Library - Volume 1.iso / html / faqs / faq / audio-fmts / part2 < prev   
Encoding:
Text File  |  1995-07-25  |  59.5 KB  |  1,528 lines

  1. Subject: FAQ: Audio File Formats (part 2 of 2)
  2. Newsgroups: alt.binaries.sounds.misc,alt.binaries.sounds.d,comp.dsp,alt.answers,comp.answers,news.answers
  3. From: guido@cwi.nl (Guido van Rossum)
  4. Date: Mon, 1 Aug 1994 08:45:47 GMT
  5.  
  6. Archive-name: audio-fmts/part2
  7. Submitted-by: Guido van Rossum <guido@cwi.nl>
  8. Version: 3.09
  9. Last-modified: 1-Aug-1994
  10.  
  11. Appendices
  12. ==========
  13.  
  14. Here are some more detailed pieces of info that I received by e-mail.
  15. They are reproduced here virtually without much editing.
  16.  
  17. Table of contents
  18. -----------------
  19.  
  20. FTP access for non-internet sites
  21. AIFF Format (Audio IFF)
  22. The NeXT/Sun audio file format
  23. IFF/8SVX Format
  24. Playing sound on a PC
  25. The EA-IFF-85 documentation
  26. US Federal Standard 1016 availability
  27. Creative Voice (VOC) file format
  28. RIFF WAVE (.WAV) file format
  29. U-LAW and A-LAW definitions
  30. AVR File Format
  31. The Amiga MOD Format
  32. The Sample Vision Format
  33. Some Miscellaneous Formats
  34. Tandy Deskmate .snd Format Notes
  35.  
  36.  
  37. ------------------------------------------------------------------------
  38. FTP access for non-internet sites
  39. ---------------------------------
  40.  
  41. From the sci.space FAQ:
  42.  
  43.     Sites not connected to the Internet cannot use FTP directly, but
  44.     there are a few automated FTP servers which operate via email.
  45.     Send mail containing only the word HELP to ftpmail@decwrl.dec.com
  46.     or bitftp@pucc.princeton.edu, and the servers will send you
  47.     instructions on how to make requests.  (The bitftp service is no
  48.     longer available through UUCP gateways due to complaints about
  49.     overuse :-( )
  50.  
  51. Also:
  52.  
  53.     FAQ lists are available by anonymous FTP from rftm.mit.edu
  54.     and by email from mail-server@rtfm.mit.edu (send a message
  55.     containing "help" for instructions about the mail server).
  56.  
  57.  
  58. ------------------------------------------------------------------------
  59. AIFF Format (Audio IFF) and AIFC
  60. --------------------------------
  61.  
  62. This format was developed by Apple for storing high-quality sampled
  63. sound and musical instrument info; it is also used by SGI and several
  64. professional audio packages (sorry, I know no names).  An extension,
  65. called AIFC or AIFF-C, supports compression (see the last item below).
  66.  
  67. I've made a BinHex'ed MacWrite version of the AIFF spec (no idea if
  68. it's the same text as mentioned below) available by anonymous ftp from
  69. ftp.cwi.nl; the file is /pub/audio/AudioIFF1.2.hqx.  A newer version
  70. is also available: /pub/audio/AudioIFF1.3.hqx.  But you may be better
  71. off with the AIFF-C specs, see below.
  72.  
  73. Mike Brindley (brindley@ece.orst.edu) writes:
  74.  
  75. "The complete AIFF spec by Steve Milne, Matt Deatherage (Apple) is
  76. available in 'AMIGA ROM Kernal Reference Manual: Devices (3rd Edition)'
  77. 1991 by Commodore-Amiga, Inc.; Addison-Wesley Publishing Co.; 
  78. ISBN 0-201-56775-X, starting on page 435 (this edition has a charcoal
  79. grey cover).  It is available in most bookstores, and soon in many
  80. good librairies."
  81.  
  82. According to Mark Callow (msc@sgi.com):
  83.  
  84. A PostScript version of the AIFF-C specification is available via
  85. anonymous ftp on ftp.sgi.com as /sgi/aiff-c.9.26.91.ps.
  86.  
  87. Benjamin Denckla <bdenckla@husc.harvard.edu> writes:
  88.  
  89. A piece of information that may be of some use to people who want to use
  90. AIFF files with their Macintosh Think C programs:  AIFF data structures are
  91. contained in the file AIFF.h in the "Apple #Includes" folder that comes
  92. on the distribution disks.  I assume that this header file comes with 
  93. Apple programming products like MPW [C|C++] as well.  I found this out a 
  94. little too late: I had already coded my own structures.  These structures 
  95. of mine, along with other useful code for AIFF-based DSP in C, are 
  96. available for ftp at ftp.cs.jhu.edu in pub/dsp.
  97.  
  98. An important file format for the Mac which is only mentioned once in the
  99. FAQ is the Sound Designer II file format.  There is also an older Sound
  100. Designer I format.  I have the SDII format in electronic form but I don't
  101. think I'm at liberty to distribute it.  It can be obtained by applying to
  102. become a 3rd Party Developer for Digidesign.  This process is simple
  103. (1-page application) and free.  Call Digidesign at 415-688-0600 for
  104. information.  The SDII file format is interesting in that all non-sample
  105. data (sample rate, channels, etc.) is contained in the resource fork and
  106. the data fork contains sample data only.
  107.  
  108. ------------------------------------------------------------------------
  109. The NeXT/Sun audio file format
  110. ------------------------------
  111.  
  112. Here's the complete story on the file format, from the NeXT
  113. documentation.  (Note that the "magic" number is ((int)0x2e736e64),
  114. which equals ".snd".)  Also, at the end, I've added a litte document
  115. that someone posted to the net a couple of years ago, that describes
  116. the format in a bit-by-bit fashion rather than from C.
  117.  
  118. I received this from Doug Keislar, NeXT Computer.  This is also the
  119. Sun format, except that Sun doesn't recognize as many format codes.  I
  120. added the numeric codes to the table of formats and sorted it.
  121.  
  122.  
  123. SNDSoundStruct:  How a NeXT Computer Represents Sound
  124.  
  125. The NeXT sound software defines the SNDSoundStruct structure to  
  126. represent sound.  This structure defines the soundfile and Mach-O  
  127. sound segment formats and the sound pasteboard type.  It's also used  
  128. to describe sounds in Interface Builder.  In addition, each instance  
  129. of the Sound Kit's Sound class encapsulates a SNDSoundStruct and  
  130. provides methods to access and modify its attributes.
  131.  
  132. Basic sound operations, such as playing, recording, and cut-and-paste  
  133. editing, are most easily performed by a Sound object.  In many cases,  
  134. the Sound Kit obviates the need for in-depth understanding of the  
  135. SNDSoundStruct architecture.  For example, if you simply want to  
  136. incorporate sound effects into an application, or to provide a simple  
  137. graphic sound editor (such as the one in the Mail application), you  
  138. needn't be aware of the details of the SNDSoundStruct.  However, if  
  139. you want to closely examine or manipulate sound data you should be  
  140. familiar with this structure.
  141.  
  142. The SNDSoundStruct contains a header, information that describes the  
  143. attributes of a sound, followed by the data (usually samples) that  
  144. represents the sound.  The structure is defined (in  
  145. sound/soundstruct.h) as:
  146.  
  147. typedef struct {
  148.     int magic;               /* magic number SND_MAGIC */
  149.     int dataLocation;        /* offset or pointer to the data */
  150.     int dataSize;            /* number of bytes of data */
  151.     int dataFormat;          /* the data format code */
  152.     int samplingRate;        /* the sampling rate */
  153.     int channelCount;        /* the number of channels */
  154.     char info[4];            /* optional text information */
  155. } SNDSoundStruct;
  156.  
  157.  
  158.  
  159.  
  160. SNDSoundStruct Fields
  161.  
  162.  
  163.  
  164. magic
  165.  
  166. magic is a magic number that's used to identify the structure as a  
  167. SNDSoundStruct.  Keep in mind that the structure also defines the  
  168. soundfile and Mach-O sound segment formats, so the magic number is  
  169. also used to identify these entities as containing a sound.
  170.  
  171.  
  172.  
  173.  
  174.  
  175. dataLocation
  176.  
  177. It was mentioned above that the SNDSoundStruct contains a header  
  178. followed by sound data.  In reality, the structure only contains the  
  179. header; the data itself is external to, although usually contiguous  
  180. with, the structure.  (Nonetheless, it's often useful to speak of the  
  181. SNDSoundStruct as the header and the data.)  dataLocation is used to  
  182. point to the data.  Usually, this value is an offset (in bytes) from  
  183. the beginning of the SNDSoundStruct to the first byte of sound data.   
  184. The data, in this case, immediately follows the structure, so  
  185. dataLocation can also be thought of as the size of the structure's  
  186. header.  The other use of dataLocation, as an address that locates  
  187. data that isn't contiguous with the structure, is described in  
  188. "Format Codes," below.
  189.  
  190.  
  191.  
  192.  
  193.  
  194. dataSize, dataFormat, samplingRate, and channelCount
  195.  
  196. These fields describe the sound data.
  197.  
  198. dataSize is its size in bytes (not including the size of the  
  199. SNDSoundStruct).
  200.  
  201. dataFormat is a code that identifies the type of sound.  For sampled  
  202. sounds, this is the quantization format.  However, the data can also  
  203. be instructions for synthesizing a sound on the DSP.  The codes are  
  204. listed and explained in "Format Codes," below.
  205.  
  206. samplingRate is the sampling rate (if the data is samples).  Three  
  207. sampling rates, represented as integer constants, are supported by  
  208. the hardware:
  209.  
  210. Constant        Sampling Rate (samples/sec) 
  211.  
  212. SND_RATE_CODEC  8012.821        (CODEC input)
  213. SND_RATE_LOW    22050.0 (low sampling rate output)
  214. SND_RATE_HIGH   44100.0 (high sampling rate output)
  215.  
  216. channelCount is the number of channels of sampled sound.
  217.  
  218.  
  219.  
  220.  
  221.  
  222. info
  223.  
  224. info is a NULL-terminated string that you can supply to provide a  
  225. textual description of the sound.  The size of the info field is set  
  226. when the structure is created and thereafter can't be enlarged.  It's  
  227. at least four bytes long (even if it's unused).
  228.  
  229.  
  230.  
  231.  
  232.  
  233. Format Codes
  234.  
  235. A sound's format is represented as a positive 32-bit integer.  NeXT  
  236. reserves the integers 0 through 255; you can define your own format  
  237. and represent it with an integer greater than 255.  Most of the  
  238. formats defined by NeXT describe the amplitude quantization of  
  239. sampled sound data:
  240.  
  241. Value   Code    Format 
  242.  
  243. 0       SND_FORMAT_UNSPECIFIED  unspecified format 
  244. 1       SND_FORMAT_MULAW_8      8-bit mu-law samples
  245. 2       SND_FORMAT_LINEAR_8     8-bit linear samples
  246. 3       SND_FORMAT_LINEAR_16    16-bit linear samples
  247. 4       SND_FORMAT_LINEAR_24    24-bit linear samples
  248. 5       SND_FORMAT_LINEAR_32    32-bit linear samples
  249. 6       SND_FORMAT_FLOAT        floating-point samples
  250. 7       SND_FORMAT_DOUBLE       double-precision float samples
  251. 8       SND_FORMAT_INDIRECT     fragmented sampled data
  252. 9       SND_FORMAT_NESTED       ?
  253. 10      SND_FORMAT_DSP_CORE     DSP program
  254. 11      SND_FORMAT_DSP_DATA_8   8-bit fixed-point samples
  255. 12      SND_FORMAT_DSP_DATA_16  16-bit fixed-point samples
  256. 13      SND_FORMAT_DSP_DATA_24  24-bit fixed-point samples
  257. 14      SND_FORMAT_DSP_DATA_32  32-bit fixed-point samples
  258. 15      ?
  259. 16      SND_FORMAT_DISPLAY      non-audio display data
  260. 17      SND_FORMAT_MULAW_SQUELCH        ?
  261. 18      SND_FORMAT_EMPHASIZED   16-bit linear with emphasis
  262. 19      SND_FORMAT_COMPRESSED   16-bit linear with compression
  263. 20      SND_FORMAT_COMPRESSED_EMPHASIZED        A combination of the two above
  264. 21      SND_FORMAT_DSP_COMMANDS Music Kit DSP commands
  265. 22      SND_FORMAT_DSP_COMMANDS_SAMPLES         ?
  266. [Some new ones supported by Sun.  This is all I currently know. --GvR]
  267. 23      SND_FORMAT_ADPCM_G721
  268. 24      SND_FORMAT_ADPCM_G722
  269. 25      SND_FORMAT_ADPCM_G723_3
  270. 26      SND_FORMAT_ADPCM_G723_5
  271. 27      SND_FORMAT_ALAW_8
  272.  
  273.  
  274. Most formats identify different sizes and types of  
  275. sampled data.  Some deserve special note:  
  276.  
  277.  
  278. --      SND_FORMAT_DSP_CORE format contains data that represents a  
  279. loadable DSP core program.  Sounds in this format are required by the  
  280. SNDBootDSP() and SNDRunDSP() functions.  You create a  
  281. SND_FORMAT_DSP_CORE sound by reading a DSP load file (extension  
  282. ".lod") with the SNDReadDSPfile() function.
  283.  
  284. --      SND_FORMAT_DSP_COMMANDS is used to distinguish sounds that  
  285. contain DSP commands created by the Music Kit.  Sounds in this format  
  286. can only be created through the Music Kit's Orchestra class, but can  
  287. be played back through the SNDStartPlaying() function.
  288.  
  289. --      SND_FORMAT_DISPLAY format is used by the Sound Kit's  
  290. SoundView class.  Such sounds can't be played.  
  291.  
  292.  
  293. --      SND_FORMAT_INDIRECT indicates data that has become  
  294. fragmented, as described in a separate section, below.  
  295.  
  296.  
  297. --      SND_FORMAT_UNSPECIFIED is used for unrecognized formats.
  298.  
  299.  
  300.  
  301.  
  302.  
  303. Fragmented Sound Data
  304.  
  305. Sound data is usually stored in a contiguous block of memory.   
  306. However, when sampled sound data is edited (such that a portion of  
  307. the sound is deleted or a portion inserted), the data may become  
  308. discontiguous, or fragmented.  Each fragment of data is given its own  
  309. SNDSoundStruct header; thus, each fragment becomes a separate  
  310. SNDSoundStruct structure.  The addresses of these new structures are  
  311. collected into a contiguous, NULL-terminated block; the dataLocation  
  312. field of the original SNDSoundStruct is set to the address of this  
  313. block, while the original format, sampling rate, and channel count  
  314. are copied into the new SNDSoundStructs.  
  315.  
  316.  
  317. Fragmentation serves one purpose:  It avoids the high cost of moving  
  318. data when the sound is edited.  Playback of a fragmented sound is  
  319. transparent-you never need to know whether the sound is fragmented  
  320. before playing it.  However, playback of a heavily fragmented sound  
  321. is less efficient than that of a contiguous sound.  The  
  322. SNDCompactSamples() C function can be used to compact fragmented  
  323. sound data.
  324.  
  325. Sampled sound data is naturally unfragmented.  A sound that's freshly  
  326. recorded or retrieved from a soundfile, the Mach-O segment, or the  
  327. pasteboard won't be fragmented.  Keep in mind that only sampled data  
  328. can become fragmented.
  329.  
  330.  
  331.  
  332. _________________________
  333. >From mentor.cc.purdue.edu!purdue!decwrl!ucbvax!ziploc!eps Wed Apr  4  
  334. 23:56:23 EST 1990
  335. Article 5779 of comp.sys.next:
  336. Path: mentor.cc.purdue.edu!purdue!decwrl!ucbvax!ziploc!eps
  337. >From: eps@toaster.SFSU.EDU (Eric P. Scott)
  338. Newsgroups: comp.sys.next
  339. Subject: Re: Format of NeXT sndfile headers?
  340. Message-ID: <445@toaster.SFSU.EDU>
  341. Date: 31 Mar 90 21:36:17 GMT
  342. References: <14978@phoenix.Princeton.EDU>
  343. Reply-To: eps@cs.SFSU.EDU (Eric P. Scott)
  344. Organization: San Francisco State University
  345. Lines: 42
  346.  
  347. In article <14978@phoenix.Princeton.EDU>
  348.         bskendig@phoenix.Princeton.EDU (Brian Kendig) writes:
  349. >I'd like to take a program I have that converts Macintosh sound  
  350. files
  351. >to NeXT sndfiles and polish it up a bit to go the other direction as
  352. >well.
  353.  
  354. Two people have already submitted programs that do this
  355. (Christopher Lane and Robert Hood); check the various
  356. NeXT archive sites.
  357.  
  358. >       Could someone please give me the format of a NeXT sndfile
  359. >header?
  360.  
  361. "big-endian"
  362.         0       1       2       3
  363.         +-------+-------+-------+-------+
  364. 0       | 0x2e  | 0x73  | 0x6e  | 0x64  |       "magic" number
  365.         +-------+-------+-------+-------+
  366. 4       |                               |       data location
  367.         +-------+-------+-------+-------+
  368. 8       |                               |       data size
  369.         +-------+-------+-------+-------+
  370. 12      |                               |       data format (enum)
  371.         +-------+-------+-------+-------+
  372. 16      |                               |       sampling rate (int)
  373.         +-------+-------+-------+-------+
  374. 20      |                               |       channel count
  375.         +-------+-------+-------+-------+
  376. 24      |       |       |       |       |       (optional) info  
  377. string
  378.  
  379. 28 = minimum value for data location
  380.  
  381. data format values can be found in /usr/include/sound/soundstruct.h
  382.  
  383. Most common combinations:
  384.  
  385.          sampling  channel    data
  386.              rate    count  format              
  387. voice file   8012        1       1 =  8-bit mu-law
  388. system beep 22050        2       3 = 16-bit linear
  389. CD-quality  44100        2       3 = 16-bit linear
  390.  
  391. ------------------------------------------------------------------------
  392. IFF/8SVX Format
  393. ---------------
  394.  
  395. Newsgroups: alt.binaries.sounds.d,alt.sex.sounds
  396. Subject: Format of the IFF header (Amiga sounds)
  397. Message-ID: <2509@tardis.Tymnet.COM>
  398. From: jms@tardis.Tymnet.COM (Joe Smith)
  399. Date: 23 Oct 91 23:54:38 GMT
  400. Followup-To: alt.binaries.sounds.d
  401. Organization: BT North America (Tymnet)
  402.  
  403. The first 12 bytes of an IFF file are used to distinguish between an Amiga
  404. picture (FORM-ILBM), an Amiga sound sample (FORM-8SVX), or other file
  405. conforming to the IFF specification.  The middle 4 bytes is the count of
  406. bytes that follow the "FORM" and byte count longwords.  (Numbers are stored
  407. in M68000 form, high order byte first.)
  408.  
  409.                 ------------------------------------------
  410.  
  411. FutureSound audio file, 15000 samples at 10.000KHz, file is 15048 bytes long.
  412.  
  413. 0000: 464F524D 00003AC0 38535658 56484452    FORM..:.8SVXVHDR
  414.       F O R M     15040 8 S V X  V H D R
  415. 0010: 00000014 00003A98 00000000 00000000    ......:.........
  416.             20    15000        0        0
  417. 0020: 27100100 00010000 424F4459 00003A98    '.......BODY..:.
  418.      10000 1 0    1.0   B O D Y     15000
  419.  
  420. 0000000..03 = "FORM", identifies this as an IFF format file.
  421. FORM+00..03 (ULONG) = number of bytes that follow.  (Unsigned long int.)
  422. FORM+03..07 = "8SVX", identifies this as an 8-bit sampled voice.
  423.  
  424. ????+00..03 = "VHDR", Voice8Header, describes the parameters for the BODY.
  425. VHDR+00..03 (ULONG) = number of bytes to follow. 
  426. VHDR+04..07 (ULONG) = samples in the high octave 1-shot part.
  427. VHDR+08..0B (ULONG) = samples in the high octave repeat part.
  428. VHDR+0C..0F (ULONG) = samples per cycle in high octave (if repeating), else 0.
  429. VHDR+10..11 (UWORD) = samples per second.  (Unsigned 16-bit quantity.)
  430. VHDR+12     (UBYTE) = number of octaves of waveforms in sample.
  431. VHDR+13     (UBYTE) = data compression (0=none, 1=Fibonacci-delta encoding).
  432. VHDR+14..17 (FIXED) = volume.  (The number 65536 means 1.0 or full volume.)
  433.  
  434. ????+00..03 = "BODY", identifies the start of the audio data.
  435. BODY+00..03 (ULONG) = number of bytes to follow.
  436. BODY+04..NNNNN      = Data, signed bytes, from -128 to +127.
  437.  
  438. 0030: 04030201 02030303 04050605 05060605
  439. 0040: 06080806 07060505 04020202 01FF0000
  440. 0050: 00000000 FF00FFFF FFFEFDFD FDFEFFFF
  441. 0060: FDFDFF00 00FFFFFF 00000000 00FFFF00
  442. 0070: 00000000 00FF0000 00FFFEFF 00000000
  443. 0080: 00010000 000101FF FF0000FE FEFFFFFE
  444. 0090: FDFDFEFD FDFFFFFC FDFEFDFD FEFFFEFE
  445. 00A0: FFFEFEFE FEFEFEFF FFFFFEFF 00FFFF01
  446.  
  447. This small section of the audio sample shows the number ranging from -5 (0xFD)
  448. to +8 (0x08).  Warning: Do not assume that the BODY starts 48 bytes into the
  449. file.  In addition to "VHDR", chunks labeled "NAME", "AUTH", "ANNO", or 
  450. "(c) " may be present, and may be in any order.  You will have to check the
  451. byte count in each chunk to determine how many bytes to skip.
  452.  
  453. ------------------------------------------------------------------------
  454. Playing sound on a PC
  455. ---------------------
  456.  
  457. From: Eric A Rasmussen
  458.  
  459. Any turbo PC (8088 at 8 Mhz or greater)/286/386/486/etc. can produce a quality
  460. playback of single channel 8 bit sounds on the internal (1 bit, 1 channel)
  461. speaker by utilizing Pulse-Width-Modulation, which toggles the speaker faster
  462. than it can physically move to simulate positions between fully on and fully
  463. off.  There are several PD programs of this nature that I know of:
  464.  
  465. REMAC  - Plays MAC format sound files.  Files on the Macintosh, at least the
  466.          sound files that I've ripped apart, seem to contain 3 parts.  The
  467.          first two are info like what the file icon looks like and other
  468.          header type info.  The third part contains the raw sample data, and
  469.          it is this portion of the file which is saved to a seperate file,
  470.          often named with the .snd extension by PC users.  Personally, I like
  471.          to name the files .s1, .s2, .s3, or .s4 to indicate the sampling rate
  472.          of the file. (-s# is how to specify the playback rate in REMAC.)
  473.          REMAC provides playback rates of 5550hz, 7333hz, 11 khz, & 22 khz.
  474. REMAC2 - Same as REMAC, but sounds better on higher speed machines.
  475. REPLAY - Basically same as REMAC, but for playback of Atari ST sounds. 
  476.          Apparently, the Atari has two sound formats, one of which sounds like
  477.          garbage if played by REMAC or REPLAY in the incorrect mode.  The
  478.          other file format works fine with REMAC and so appears to be 'normal'
  479.          unsigned 8-bit data.  REPLAY provides playback rates of 11.5 khz,
  480.          12.5 khz, 14 khz, 16 khz, 18.5 khz, 22khz, & 27 khz.
  481.  
  482. These three programs are all by the same author, Richard E. Zobell who does
  483. not have an internet mail address to my knowledge, but does have a GEnie email
  484. address of R.ZOBELL. 
  485.  
  486. Additionally, there are various stand-alone demos which use the internal
  487. speaker, of which there is one called mushroom which plays a 30 second
  488. advertising jingle for magic mushroom room deoderizers which is pretty
  489. humerous.  I've used this player to playback samples that I ripped out of the
  490. commercial game program Mean Streets, which uses something they call RealSound
  491. (tm) to playback digital samples on the internal speaker. (Of course, I only do
  492. this on my own system, and since I own the game, I see no problems with it.)
  493.  
  494. For owners of 8 Mhz 286's and above, the option to play 4 channel 8 bit sounds
  495. (with decent quality) on the internal speaker is also a reality.  Quite a
  496. number of PD programs exist to do this, including, but not limited to:
  497.  
  498. ModEdit, ModPlay, ScreamTracker, STM, Star Trekker, Tetra, and probably a few
  499. more.  
  500.  
  501. All these programs basically make use of various sound formats used by the
  502. Amiga line of computers.  These include .stm files, .mod files
  503. [a.k.a. mod. files], and .nst files [really the same hing].  Also,
  504. these programs pretty much all have the option to playback the 
  505. sound to add-on hardware such as the SoundBlaster card, the Covox series of
  506. devices, and also to direct the data to either one or two (for stereo)
  507. parallel ports, which you could attach your own D/A's to.  (From what I have
  508. seen, the Covox is basically an small amplified speaker with a D/A which plugs
  509. into the parallel port.  This sounds very similiar to the Disney Sound System
  510. (DSS) which people have been talking about recently.)  
  511.  
  512. ------------------------------------------------------------------------
  513. The EA-IFF-85 documentation
  514. ---------------------------
  515.  
  516. From: dgc3@midway.uchicago.edu
  517.  
  518. As promised, here's an ftp location for the EA-IFF-85 documentation.  It's
  519. the November 1988 release as revised by Commodore (the last public release),
  520. with specifications for IFF FORMs for graphics, sound, formatted text, and
  521. more.  IFF FORMS now exist for other media, including structured drawing, and
  522. new documentation is now available only from Commodore.
  523.  
  524. The documentation is at grind.isca.uiowa.edu, in the directory
  525. /amiga/f1/ff185.  The complete file list is as follows:
  526.  
  527. DOCUMENTS.zoo    
  528. EXAMPLES.zoo     
  529. EXECUTABLE.zoo   
  530. INCLUDE.zoo      
  531. LINKER_INFO.zoo  
  532. OBJECT.zoo       
  533. SOURCE.zoo       
  534. TP_IFF_Specs.zoo 
  535.  
  536. All files except DOCUMENTS.zoo are Amiga-specific, but may be used as a basis
  537. for conversion to other platforms.  Well, I take that tentatively back.  I
  538. don't know what TP_IFF_Specs.zoo contains, so it might be non-Amiga-specific.
  539.  
  540. ------------------------------------------------------------------------
  541. US Federal Standard 1016 availability
  542. -------------------------------------
  543.  
  544. From: jpcampb@afterlife.ncsc.mil (Joe Campbell)
  545.  
  546. The U.S. DoD's Federal-Standard-1016 based 4800 bps code excited linear
  547. prediction voice coder version 3.2 (CELP 3.2) Fortran and C simulation
  548. source codes are available for worldwide distribution (on DOS
  549. diskettes, but configured to compile on Sun SPARC stations) from NTIS
  550. and DTIC.  Example input and processed speech files are included.  A
  551. Technical Information Bulletin (TIB), "Details to Assist in
  552. Implementation of Federal Standard 1016 CELP," and the official
  553. standard, "Federal Standard 1016, Telecommunications:  Analog to
  554. Digital Conversion of Radio Voice by 4,800 bit/second Code Excited
  555. Linear Prediction (CELP)," are also available.
  556.  
  557. This is available through the National Technical Information Service:
  558.  
  559. NTIS
  560. U.S. Department of Commerce
  561. 5285 Port Royal Road
  562. Springfield, VA  22161
  563. USA
  564. (703) 487-4650
  565.  
  566. The "AD" ordering number for the CELP software is AD M000 118
  567. (US$ 90.00) and for the TIB it's AD A256 629 (US$ 17.50).  The LPC-10
  568. standard, described below, is FIPS Pub 137 (US$ 12.50).  There is a
  569. $3.00 shipping charge on all U.S. orders.  The telephone number for
  570. their automated system is 703-487-4650, or 703-487-4600 if you'd prefer
  571. to talk with a real person.
  572.  
  573. (U.S. DoD personnel and contractors can receive the package from the
  574. Defense Technical Information Center:  DTIC, Building 5, Cameron
  575. Station, Alexandria, VA 22304-6145.  Their telephone number is
  576. 703-274-7633.)
  577.  
  578. The following articles describe the Federal-Standard-1016 4.8-kbps CELP
  579. coder (it's unnecessary to read more than one):
  580.  
  581. Campbell, Joseph P. Jr., Thomas E. Tremain and Vanoy C. Welch,
  582. "The Federal Standard 1016 4800 bps CELP Voice Coder," Digital Signal
  583. Processing, Academic Press, 1991, Vol. 1, No. 3, p. 145-155.
  584.  
  585. Campbell, Joseph P. Jr., Thomas E. Tremain and Vanoy C. Welch,
  586. "The DoD 4.8 kbps Standard (Proposed Federal Standard 1016),"
  587. in Advances in Speech Coding, ed. Atal, Cuperman and Gersho,
  588. Kluwer Academic Publishers, 1991, Chapter 12, p. 121-133.
  589.  
  590. Campbell, Joseph P. Jr., Thomas E. Tremain and Vanoy C. Welch, "The
  591. Proposed Federal Standard 1016 4800 bps Voice Coder:  CELP," Speech
  592. Technology Magazine, April/May 1990, p. 58-64.
  593.  
  594.  
  595. The U.S. DoD's Federal-Standard-1015/NATO-STANAG-4198 based 2400 bps
  596. linear prediction coder (LPC-10) was republished as a Federal
  597. Information Processing Standards Publication 137 (FIPS Pub 137).
  598. It is described in:
  599.  
  600. Thomas E. Tremain, "The Government Standard Linear Predictive Coding
  601. Algorithm:  LPC-10," Speech Technology Magazine, April 1982, p. 40-49.
  602.  
  603. There is also a section about FS-1015 in the book:
  604. Panos E. Papamichalis, Practical Approaches to Speech Coding,
  605. Prentice-Hall, 1987.
  606.  
  607. The voicing classifier used in the enhanced LPC-10 (LPC-10e) is described in:
  608. Campbell, Joseph P., Jr. and T. E. Tremain, "Voiced/Unvoiced Classification
  609. of Speech with Applications to the U.S. Government LPC-10E Algorithm,"
  610. Proceedings of the IEEE International Conference on Acoustics, Speech, and
  611. Signal Processing, 1986, p. 473-6.
  612.  
  613. Copies of the official standard
  614. "Federal Standard 1016, Telecommunications: Analog to Digital Conversion
  615. of Radio Voice by 4,800 bit/second Code Excited Linear Prediction (CELP)"
  616. are available for US$ 5.00 each from:
  617.  
  618. GSA Federal Supply Service Bureau
  619. Specification Section, Suite 8100
  620. 470 E. L'Enfant Place, S.W.
  621. Washington, DC  20407
  622. (202)755-0325
  623.  
  624. Realtime DSP code for FS-1015 and FS-1016 is sold by:
  625.  
  626. John DellaMorte
  627. DSP Software Engineering
  628. 165 Middlesex Tpk, Suite 206
  629. Bedford, MA  01730
  630. USA
  631. 1-617-275-3733
  632. 1-617-275-4323 (fax)
  633. dspse.bedford@channel1.com
  634.  
  635. DSP Software Engineering's FS-1016 code can run on a DSP Research's Tiger 30
  636. (a PC board with a TMS320C3x and analog interface suited to development work).
  637.  
  638. DSP Research                
  639. 1095 E. Duane Ave.          
  640. Sunnyvale, CA  94086        
  641. USA
  642. (408)773-1042               
  643. (408)736-3451 (fax)         
  644.  
  645. From: cfreese@super.org (Craig F. Reese)
  646. Newsgroups: comp.speech,comp.dsp,comp.compression.research
  647. Subject: CELP 3.2a release now available
  648. Organization: Supercomputing Research Center (Bowie, MD)
  649. Date: Tue, 3 Aug 1993 14:55:25 GMT
  650.  
  651. 3 August 1993
  652.  
  653. CELP 3.2a Release
  654.  
  655. Dear CELPers,
  656.  
  657. We have placed an updated version of the FS-1016 CELP 3.2 code in the
  658. anonymous FTP area on super.org.  It's in:
  659.  
  660.   /pub/celp_3.2a.tar.Z (please be sure to do the ftp in binary mode).
  661.  
  662. This is essentially the PC release that was on fumar, except that we
  663. started directly from the PC disks.  The value added is that we have
  664. made over 69 corrections and fixes.  Most of these were necessary
  665. because of the 8 character file name limit on DOS, but there are some
  666. others, as well.
  667.  
  668. The code (C, FORTRAN, diskio) all has been built and tested on a Sun4
  669. under SunOS4.1.3.  If you want to run it somewhere else, then you may
  670. have to do a bit of work.  (A Solaris 2.x-compatible release is
  671. planned soon.)
  672.  
  673. [One note to PCers.  The files:
  674. [
  675. [       cbsearch.F celp.F csub.F mexcite.F psearch.F
  676. [
  677. [are meant to be passed through the C preprocessor (cpp).
  678. [We gather that DOS (or whatever it's called) can't distinguish 
  679. [the .F from a .f.  Be careful!
  680.  
  681. Very limited support is available from the authors (Joe, et al.).
  682. Please do not send questions or suggestions without first reading the
  683. documentation (README files, the Technical Information Bulletin, etc.).
  684. The authors would enjoy hearing from you, but they have limited time
  685. for support and would like to use it as efficiently as possible.  They
  686. welcome bug reports, but, again, please read the documentation first.
  687. All users of FS-1016 CELP software are strongly encouraged to acquire
  688. the latest release (version 3.2a as of this writing).
  689.  
  690. We do not know how long we will be able to leave the software on this
  691. site, but it should be _at_least_ through 1 October 1993 (if you find
  692. it missing, please drop me (Craig) a note).  Please try to get the
  693. software during off hours (8 p.m. - 7 a.m. Eastern Standard time) or
  694. folks here might complain and we'll have to get rid of the code (if
  695. that happens, we'll try to pass it on to someone else, who can put it
  696. on the net).  We would be more than happy for someone to copy it and
  697. make it available elsewhere.
  698.  
  699. Good Luck,
  700.  
  701. Craig F. Reese  (cfreese@super.org)
  702. IDA/Supercomputing Research Center
  703.  
  704. Joe Campbell (jpcampb@afterlife.ncsc.mil)
  705. Department of Defense
  706.  
  707. P.S.  Just so you all know, I (Craig) am not actually involved in
  708. CELP work.  I mainly got with Joe to help make the software available
  709. on the Internet.  In the course of doing so, I cleaned up much of it,
  710. but I am not, by any stretch, a CELP expert and will most likely
  711. be unable to answer any technical questions concerning it. ;^)
  712.  
  713. From: tobiasr@monolith.lrmsc.loral.com (Richard Tobias)
  714.  
  715. For U.S. FED-STD-1016 (4800 bps CELP) _realtime_ DSP code and
  716. information about products using this code using the AT&T DSP32C and
  717. AT&T DSP3210, contact:
  718.  
  719. White Eagle Systems Technology, Inc.
  720. 1123 Queensbridge Way
  721. San Jose, CA 95120
  722. (408) 997-2706
  723. (408) 997-3584 (fax)
  724. rjjt@netcom.com
  725.  
  726. From: Cole Erskine <cole@analogical.com>
  727.  
  728. [paraphrased]
  729.  
  730. Analogical Systems has a _real-time_ multirate implementation of U.S.
  731. Federal Standard 1016 CELP operating at bit rates of 4800, 7200, and
  732. 9600 bps on a single 27MHz Motorola DSP56001. Source and object code
  733. is available for a one-time license fee.
  734.  
  735. FREE, _real-time_ demonstration software for the Ariel PC-56D is
  736. available for those who already have such a board by contacting
  737. Analogical Systems.  The demo software allows you to record and
  738. playback CELP files to and from the PC's hard disk.
  739.  
  740. Analogical Systems
  741. 2916 Ramona Street
  742. Palo Alto, CA 94306
  743. Tel: +1 (415) 323-3232
  744. FAX: +1 (415) 323-4222
  745.  
  746. ------------------------------------------------------------------------
  747. Creative Voice (VOC) file format
  748. --------------------------------
  749.  
  750. From: galt@dsd.es.com
  751.  
  752. (byte numbers are hex!)
  753.  
  754.     HEADER (bytes 00-19)
  755.     Series of DATA BLOCKS (bytes 1A+) [Must end w/ Terminator Block]
  756.  
  757. - ---------------------------------------------------------------
  758.  
  759. HEADER:
  760. =======
  761.      byte #     Description
  762.      ------     ------------------------------------------
  763.      00-12      "Creative Voice File"
  764.      13         1A (eof to abort printing of file)
  765.      14-15      Offset of first datablock in .voc file (std 1A 00
  766.                 in Intel Notation)
  767.      16-17      Version number (minor,major) (VOC-HDR puts 0A 01)
  768.      18-19      2's Comp of Ver. # + 1234h (VOC-HDR puts 29 11)
  769.  
  770. - ---------------------------------------------------------------
  771.  
  772. DATA BLOCK:
  773. ===========
  774.  
  775.    Data Block:  TYPE(1-byte), SIZE(3-bytes), INFO(0+ bytes)
  776.    NOTE: Terminator Block is an exception -- it has only the TYPE byte.
  777.  
  778.       TYPE   Description     Size (3-byte int)   Info
  779.       ----   -----------     -----------------   -----------------------
  780.       00     Terminator      (NONE)              (NONE)
  781.       01     Sound data      2+length of data    *
  782.       02     Sound continue  length of data      Voice Data
  783.       03     Silence         3                   **
  784.       04     Marker          2                   Marker# (2 bytes)
  785.       05     ASCII           length of string    null terminated string
  786.       06     Repeat          2                   Count# (2 bytes)
  787.       07     End repeat      0                   (NONE)
  788.       08     Extended        4                   ***
  789.  
  790.       *Sound Info Format:       **Silence Info Format:
  791.        ---------------------      ----------------------------
  792.        00   Sample Rate           00-01  Length of silence - 1
  793.        01   Compression Type      02     Sample Rate
  794.        02+  Voice Data
  795.  
  796.     ***Extended Info Format:
  797.        ---------------------
  798.        00-01  Time Constant: Mono: 65536 - (256000000/sample_rate)
  799.                              Stereo: 65536 - (25600000/(2*sample_rate))
  800.        02     Pack
  801.        03     Mode: 0 = mono
  802.                     1 = stereo
  803.  
  804.  
  805.   Marker#           -- Driver keeps the most recent marker in a status byte
  806.   Count#            -- Number of repetitions + 1
  807.                          Count# may be 1 to FFFE for 0 - FFFD repetitions
  808.                          or FFFF for endless repetitions
  809.   Sample Rate       -- SR byte = 256-(1000000/sample_rate)
  810.   Length of silence -- in units of sampling cycle
  811.   Compression Type  -- of voice data
  812.                          8-bits    = 0
  813.                          4-bits    = 1
  814.                          2.6-bits  = 2
  815.                          2-bits    = 3
  816.                          Multi DAC = 3+(# of channels) [interesting--
  817.                                        this isn't in the developer's manual]
  818.  
  819. ------------------------------------------------------------------------
  820. RIFF WAVE (.WAV) file format
  821. ----------------------------
  822.  
  823. RIFF is a format by Microsoft and IBM which is similar in spirit and
  824. functionality as EA-IFF-85, but not compatible (and it's in
  825. little-endian byte order, of course :-).  WAVE is RIFF's equivalent of
  826. AIFF, and its inclusion in Microsoft Windows 3.1 has suddenly made it
  827. important to know about.
  828.  
  829. Rob Ryan was kind enough to send me a description of the RIFF format.
  830. Unfortunately, it is too big to include here (27 k), but I've made it
  831. available for anonymous ftp as ftp.cwi.nl:/pub/audio/RIFF-format.
  832.  
  833. The complete definition of the WAVE file format as defined by IBM and
  834. Microsoft is available for anonymous FTP from ftp.microsoft.com, in
  835. directory developer/MSDN/CD8 as file RIFFNE.ZIP, which contains a MS
  836. help file (riffne.hlp).
  837.  
  838. ------------------------------------------------------------------------
  839. U-LAW and A-LAW definitions
  840. ---------------------------
  841.  
  842. [Adapted from information provided by duggan@cc.gatech.edu (Rick
  843. Duggan) and davep@zenobia.phys.unsw.EDU.AU (David Perry)]
  844.  
  845. u-LAW (really mu-LAW) is
  846.  
  847.           sgn(m)   (     |m |)       |m |
  848.    y=    ------- ln( 1+ u|--|)       |--| =< 1
  849.          ln(1+u)   (     |mp|)       |mp|         
  850.  
  851. A-LAW is
  852.  
  853.      |     A    (m )                 |m |    1
  854.      |  ------- (--)                 |--| =< - 
  855.      |  1+ln A  (mp)                 |mp|    A     
  856.    y=|
  857.      | sgn(m) (        |m |)    1    |m |
  858.      | ------ ( 1+ ln A|--|)    - =< |--| =< 1
  859.      | 1+ln A (        |mp|)    A    |mp|         
  860.  
  861. Values of u=100 and 255, A=87.6, mp is the Peak message value, m is
  862. the current quantised message value.  (The formulae get simpler if you
  863. substitute x for m/mp and sgn(x) for sgn(m); then -1 <= x <= 1.)
  864.  
  865. Converting from u-LAW to A-LAW is in a sense "lossy" since there are
  866. quantizing errors introduced in the conversion.
  867.  
  868. "..the u-LAW used in North America and Japan, and the
  869. A-LAW used in Europe and the rest of the world and
  870. international routes.."
  871.  
  872. References:
  873.  
  874. Modern Digital and Analog Communication Systems, B.P.Lathi., 2nd ed.
  875. ISBN 0-03-027933-X
  876.  
  877. Transmission Systems for Communications
  878. Fifth Edition
  879. by Members of the Technical Staff at Bell Telephone Laboratories
  880. Bell Telephone Laboratories, Incorporated
  881. Copyright 1959, 1964, 1970, 1982
  882.  
  883. A note on the resolution of U-LAW by Frank Klemm <pfk@rz.uni-jena.de>:
  884.  
  885. 8 bit U-LAW has the same lowest  magnitude like 12 bit linear and 12 bit
  886. U-LAW like 16 linear.
  887.  
  888. Device/Coding   Resolution              Resolution
  889.                 on maximal level        on low level
  890.  8 bit linear    8                       8
  891.  8 bit ulaw      6                      12      (used for digital telephone)
  892. 12 bit linear   12                      12
  893. 12 bit ulaw     10                      16      (used in DAT/Longplay)
  894. 16 bit linear   16                      16
  895.  
  896. estimated for some analoge technique:
  897. tape recorder (HiFi DIN)
  898.                  8                       9      (no Problem today)
  899. tape recorder (semiprofessional)
  900.                 10.5                    13.5 
  901.  
  902. ------------------------------------------------------------------------
  903. AVR File Format
  904. ---------------
  905.  
  906. From: hyc@hanauma.Jpl.Nasa.Gov (Howard Chu)
  907.  
  908. A lot of PD software exists to play Mac .snd files on the ST. One other
  909. format that seems pretty popular (used by a number of commercial packages)
  910. is the AVR format (from Audio Visual Research). This format has a 128 byte
  911. header that looks like this:
  912.  
  913.         char magic[4]="2BIT";
  914.         char name[8];           /* null-padded sample name */
  915.         short mono;             /* 0 = mono, 0xffff = stereo */
  916.         short rez;              /* 8 = 8 bit, 16 = 16 bit */
  917.         short sign;             /* 0 = unsigned, 0xffff = signed */
  918.         short loop;             /* 0 = no loop, 0xffff = looping sample */
  919.         short midi;             /* 0xffff = no MIDI note assigned,
  920.                                    0xffXX = single key note assignment
  921.                                    0xLLHH = key split, low/hi note */
  922.         long rate;              /* sample frequency in hertz */
  923.         long size;              /* sample length in bytes or words (see rez) */
  924.         long lbeg;              /* offset to start of loop in bytes or words.
  925.                                    set to zero if unused. */
  926.         long lend;              /* offset to end of loop in bytes or words.
  927.                                    set to sample length if unused. */
  928.         short res1;             /* Reserved, MIDI keyboard split */
  929.         short res2;             /* Reserved, sample compression */
  930.         short res3;             /* Reserved */
  931.         char ext[20];           /* Additional filename space, used
  932.                                    if (name[7] != 0) */
  933.         char user[64];          /* User defined. Typically ASCII message. */
  934.  
  935. -----------------------------------------------------------------------
  936. The Amiga MOD Format
  937. --------------------
  938.  
  939. From: norlin@mailhost.ecn.uoknor.edu (Norman Lin)
  940.  
  941. MOD files are music files containing 2 parts:
  942.  
  943. (1) a bank of digitized samples
  944. (2) sequencing information describing how and when to play the samples
  945.  
  946. MOD files originated on the Amiga, but because of their flexibility
  947. and the extremely large number of MOD files available, MOD players
  948. are now available for a variety of machines (IBM PC, Mac, Sparc
  949. Station, etc.)
  950.  
  951. The samples in a MOD file are raw, 8 bit, signed, headerless, linear
  952. digital data.  There may be up to 31 distinct samples in a MOD file,
  953. each with a length of up to 128K (though most are much smaller; say,
  954. 10K - 60K).  An older MOD format only allowed for up to 15 samples in
  955. a MOD file; you don't see many of these anymore.  There is no standard
  956. sampling rate for these samples.  [But see below.]
  957.  
  958. The sequencing information in a MOD file contains 4 tracks of
  959. information describing which, when, for how long, and at what frequency
  960. samples should be played.  This means that a MOD file can have up
  961. to 31 distinct (digitized) instrument sounds, with up to 4 playing
  962. simultaneously at any given point.  This allows a wide variety
  963. of orchestrational possibilities, including use of voice samples
  964. or creation of one's own instruments (with appropriate sampling
  965. hardware/software).  The ability to use one's own samples as instruments
  966. is a flexibility that other music files/formats do not share, and
  967. is one of the reasons MOD files are so popular, numerous, and diverse.
  968.  
  969. 15 instrument MODs, as noted above, are somewhat older than 31
  970. instrument MODs and are not (at least not by me) seen very often
  971. anymore.  Their format is identical to that of 31 instrument MODs
  972. except:
  973.  
  974. (1) Since there are only 15 samples, the information for the last (15th)
  975.     sample starts at byte 440 and goes through byte 469.
  976. (2) The songlength is at byte 470 (contrast with byte 950 in 31 instrument
  977.     MOD)
  978. (3) Byte 471 appears to be ignored, but has been observed to be 127.
  979.     (Sorry, this is from observation only)
  980. (4) Byte 472 begins the pattern sequence table (contrast with byte 952
  981.     in a 31 instrument MOD)
  982. (5) Patterns start at byte 600 (contrast with byte 1084 in 31 instrument MOD)
  983.  
  984. "ProTracker," an Amiga MOD file creator/editor, is available for ftp
  985. everywhere as pt??.lzh.
  986.  
  987. From: Apollo Wong <apollo@ee.ualberta.ca>
  988.  
  989. From: M.J.H.Cox@bradford.ac.uk (Mark Cox)
  990. Newsgroups: alt.sb.programmer
  991. Subject: Re: Format for MOD files...
  992. Message-ID: <1992Mar18.103608.4061@bradford.ac.uk>
  993. Date: 18 Mar 92 10:36:08 GMT
  994. Organization: University of Bradford, UK
  995.  
  996. wdc50@DUTS.ccc.amdahl.com (Winthrop D Chan) writes:
  997. >I'd like to know if anyone has a reference document on the format of the
  998. >Amiga Sound/NoiseTracker (MOD) files. The author of Modplay said he was going
  999. >to release such a document sometime last year, but he never did. If anyone
  1000.  
  1001. I found this one, which covers it better than I can explain it - if you
  1002. use this in conjunction with the documentation that comes with Norman
  1003. Lin's Modedit program it should pretty much cover it.
  1004.  
  1005. Mark J Cox
  1006.  
  1007. /***********************************************************************
  1008.  
  1009. Protracker 1.1B Song/Module Format:
  1010. -----------------------------------
  1011.  
  1012. Offset  Bytes  Description
  1013. ------  -----  -----------
  1014.    0     20    Songname. Remember to put trailing null bytes at the end...
  1015.  
  1016. Information for sample 1-31:
  1017.  
  1018. Offset  Bytes  Description
  1019. ------  -----  -----------
  1020.   20     22    Samplename for sample 1. Pad with null bytes.
  1021.   42      2    Samplelength for sample 1. Stored as number of words.
  1022.                Multiply by two to get real sample length in bytes.
  1023.   44      1    Lower four bits are the finetune value, stored as a signed
  1024.                four bit number. The upper four bits are not used, and
  1025.                should be set to zero.
  1026.                Value:  Finetune:
  1027.                  0        0
  1028.                  1       +1
  1029.                  2       +2
  1030.                  3       +3
  1031.                  4       +4
  1032.                  5       +5
  1033.                  6       +6
  1034.                  7       +7
  1035.                  8       -8
  1036.                  9       -7
  1037.                  A       -6
  1038.                  B       -5
  1039.                  C       -4
  1040.                  D       -3
  1041.                  E       -2
  1042.                  F       -1
  1043.  
  1044.   45      1    Volume for sample 1. Range is $00-$40, or 0-64 decimal.
  1045.   46      2    Repeat point for sample 1. Stored as number of words offset
  1046.                from start of sample. Multiply by two to get offset in bytes.
  1047.   48      2    Repeat Length for sample 1. Stored as number of words in
  1048.                loop. Multiply by two to get replen in bytes.
  1049.  
  1050. Information for the next 30 samples starts here. It's just like the info for
  1051. sample 1.
  1052.  
  1053. Offset  Bytes  Description
  1054. ------  -----  -----------
  1055.   50     30    Sample 2...
  1056.   80     30    Sample 3...
  1057.    .
  1058.    .
  1059.    .
  1060.  890     30    Sample 30...
  1061.  920     30    Sample 31...
  1062.  
  1063. Offset  Bytes  Description
  1064. ------  -----  -----------
  1065.  950      1    Songlength. Range is 1-128.
  1066.  951      1    Well... this little byte here is set to 127, so that old
  1067.                trackers will search through all patterns when loading.
  1068.                Noisetracker uses this byte for restart, but we don't.
  1069.  952    128    Song positions 0-127. Each hold a number from 0-63 that
  1070.                tells the tracker what pattern to play at that position.
  1071. 1080      4    The four letters "M.K." - This is something Mahoney & Kaktus
  1072.                inserted when they increased the number of samples from
  1073.                15 to 31. If it's not there, the module/song uses 15 samples
  1074.                or the text has been removed to make the module harder to
  1075.                rip. Startrekker puts "FLT4" or "FLT8" there instead.
  1076.  
  1077. Offset  Bytes  Description
  1078. ------  -----  -----------
  1079. 1084    1024   Data for pattern 00.
  1080.    .
  1081.    .
  1082.    .
  1083. xxxx  Number of patterns stored is equal to the highest patternnumber
  1084.       in the song position table (at offset 952-1079).
  1085.  
  1086. Each note is stored as 4 bytes, and all four notes at each position in
  1087. the pattern are stored after each other.
  1088.  
  1089. 00 -  chan1  chan2  chan3  chan4
  1090. 01 -  chan1  chan2  chan3  chan4
  1091. 02 -  chan1  chan2  chan3  chan4
  1092. etc.
  1093.  
  1094. Info for each note:
  1095.  
  1096.  _____byte 1_____   byte2_    _____byte 3_____   byte4_
  1097. /                \ /      \  /                \ /      \
  1098. 0000          0000-00000000  0000          0000-00000000
  1099.  
  1100. Upper four    12 bits for    Lower four    Effect command.
  1101. bits of sam-  note period.   bits of sam-
  1102. ple number.                  ple number.
  1103.  
  1104. Periodtable for Tuning 0, Normal
  1105.   C-1 to B-1 : 856,808,762,720,678,640,604,570,538,508,480,453
  1106.   C-2 to B-2 : 428,404,381,360,339,320,302,285,269,254,240,226
  1107.   C-3 to B-3 : 214,202,190,180,170,160,151,143,135,127,120,113
  1108.  
  1109. To determine what note to show, scan through the table until you find
  1110. the same period as the one stored in byte 1-2. Use the index to look
  1111. up in a notenames table.
  1112.  
  1113. This is the data stored in a normal song. A packed song starts with the
  1114. four letters "PACK", but i don't know how the song is packed: You can
  1115. get the source code for the cruncher/decruncher from us if you need it,
  1116. but I don't understand it; I've just ripped it from another tracker...
  1117.  
  1118. In a module, all the samples are stored right after the patterndata.
  1119. To determine where a sample starts and stops, you use the sampleinfo
  1120. structures in the beginning of the file (from offset 20). Take a look
  1121. at the mt_init routine in the playroutine, and you'll see just how it
  1122. is done.
  1123.  
  1124. Lars "ZAP" Hamre/Amiga Freelancers
  1125.  
  1126. ***********************************************************************/
  1127.  
  1128. -- 
  1129. Mark J Cox -----
  1130. Bradford, UK ---
  1131.  
  1132.  
  1133. PS: A file with even *much* more info on MOD files, compiled by Lars
  1134. Hamre, is available from ftp.cwi.nl:/pub/audio/MOD-info.  Enjoy!
  1135.  
  1136.  
  1137. FTP sites for MODs and MOD players
  1138. ----------------------------------
  1139.  
  1140. Subject: MODS AND PLAYERS!! **READ** info/where to get them
  1141. From: cjohnson@tartarus.uwa.edu.au (Christopher Johnson)
  1142. Newsgroups: alt.binaries.sounds.d
  1143. Message-ID: <1h32ivINNglu@uniwa.uwa.edu.au>
  1144. Date: 21 Dec 92 00:19:43 GMT
  1145. Organization: The University of Western Australia
  1146.  
  1147. Hello world,
  1148.  
  1149. For all those asking, here is where to get those mod players and mods.
  1150.  
  1151. SNAKE.MCS.KENT.EDU is the best site for general stuff.  look in /pub/SB-Adlib
  1152.  
  1153. Simtel-20 or archie.au(simtel mirror) in <msdos.sound>
  1154.  
  1155. for windows players ftp.cica.indiana.edu in pub/pc/win3/sound
  1156.  
  1157. here is a short list of players
  1158.  
  1159. mp or modplay   BEST OVERALL                    mp219b.zip      
  1160.         simtel and snake
  1161.  
  1162. wowii           best for vga/fast machines      wowii12b.zip    
  1163.         simtel and snake
  1164.  
  1165. trakblaster     best for compatability          trak-something  
  1166.         simtel and snake        two versions, old one for slow
  1167.         machines
  1168.  
  1169. ss              cute display(hifi)              have_sex.arj
  1170.         found on local BBS (western Australia White Ghost)
  1171.  
  1172. superpro player generally good                  ssp.zip or similar
  1173.         found on night owl 7 CD
  1174.  
  1175. player?         cute display(hifi)              player.zip or similar
  1176.         found on night owl 7 CD
  1177.  
  1178. WINDOWS
  1179.  
  1180. Winmod pro      does protracker                 wmp????.zip
  1181.         cica
  1182.  
  1183. winmod          more stable                     winmod12.zip or similar
  1184.         cica
  1185.  
  1186. Hope this helps, e-mail me if you find any more players and I will add them in for the next time mod player requests get a
  1187. little out of hand.
  1188.  
  1189. for mods ftp to wuarchive.wustl.edu and go to the amiga music directory (pub/amiga/music/ntsb ?????)  that should do you for
  1190. a while
  1191.  
  1192. see you soon
  1193.  
  1194. Chris.
  1195.  
  1196. -----------------------------------------------------------------------
  1197. The Sample Vision Format
  1198. ------------------------
  1199.  
  1200. From: "tim.dorcas@enest.com" <KURTZ@URIACC.URI.EDU>
  1201.  
  1202. First, Sample Vision is a program used by professional musicians to
  1203. send and receive samples via a MIDI interface to the PC. While on the
  1204. PC, you can edit several parameters including loop points, pitch, time
  1205. compression, normalize, sample rate, ect.  The list of supported
  1206. samplers include: AKAI {S700,X700,S900, S950,S612,S1000/1100},
  1207. Casio{FZ1,FZ10M,FZ20M}, Ensoniq{EPS,EPS16,ASR10,Mirage},
  1208. Emu{Emax,EmaxII}, Korg{DSS1,DSM1,T workstation}, Oberheim DPX-1,
  1209. Peavey DPM-3, Roland {S10,MKS100,S220,S50,S330,S550}, Sequential
  1210. Circuits Prophet 2000/2002, Sample Dump Standard devices, Yamaha
  1211. TX16W.
  1212.  
  1213. The .smp format breaks down like this:
  1214.  
  1215. Offset     Size        Description
  1216. 000        18          'SOUND SAMPLE DATA ' ASCII FILE ID
  1217. 0018       04          '2.1 '   ASCII FILE VERSION
  1218. 0022       60          USER COMMENTS    60 ASCII CHARACTERS
  1219. 0082       30          SAMPLE NAME    LEFT JUSTIFIED 30 ASCII CHARACTERS
  1220. 0112       04          SAMPLE SIZE   SAMPLE DATA COUNT IN WORDS
  1221. 0116       ??          SAMPLE DATA  1 WORD PER SAMPLE, LEAST SIGNIFICANT BYTE
  1222.                                     FIRST, LSW FIRST; SIGNED 16 BIT INTEGERS
  1223.  
  1224. ??         02(DW)      RESERVED
  1225. ??         04(DD)      LOOP 1 START  USE SAMPLE COUNT NOT BYTE COUNT
  1226. ??         04(DD)      LOOP 1 END
  1227. ??         01(DB)      LOOP 1 TYPE   0=LOOP OFF,1=FORWARD,2=FORWARD/BACKWARD
  1228. ??         02(DW)      LOOP 1 COUNT  TIMES TO EXECUTE LOOP BEFORE NEXT LOOP
  1229.  
  1230. THERE ARE SEVEN MORE IDENTICAL LOOP STRUCTURES FOR A TOTAL OF 8
  1231.  
  1232. ??         10          MARKER 1 NAME ASCII MARKER NAME
  1233. ??         04(DD)      MARKER 1 POSITION  FFFF MEANS UNUSED
  1234.  
  1235. THER ARE SEVEN MORE IDENTICAL MARKER STRUCTURES FOR A TOTAL OF 8
  1236.  
  1237. ??         01(DB)       MIDI UNITY PLAYBACK NOTE         MIDI NOTE TO PLAY
  1238.                                                          THE SAMPLE AT ITS
  1239.                                                          ORIGINAL PITCH
  1240. ??         04(DD)       SAMPLE RATE IN HERTZ
  1241. ??         04(DD)       SMPTE OFFSET IN SUBFRAMES
  1242. ??         04(DD)       CYCLE SIZE         SAMPLE COUNT IN ONE CYCLE OF
  1243.                                            THE SAMPLED SOUND. -1 IF UNKNOWN
  1244.  
  1245. (DD) 4 BYTES, LS BYTE FIRST, LS WORD FIRST
  1246. (DW) 2 BYTES, LS BYTE FIRST
  1247. (DB) 1 BYTE
  1248.  
  1249. That's about it. One thing I have noticed is that Sample Vision only
  1250. writes seven loop structures to file as opposed to the eight
  1251. structures it claims are written.
  1252. -----------------------------------------------------------------------
  1253. Some Miscellaneous Formats
  1254. --------------------------
  1255.  
  1256. From: bil@ccrma.Stanford.EDU (Bill Schottstaedt)
  1257.  
  1258. I thought you might find some of this information amusing -- a few
  1259. header formats I didn't find in your great audio file formats
  1260. documentation.  Some taken from the AFsp sources, or sox, or
  1261. local ancient documentation.  I also have short descriptions
  1262. of BICSF, NeXT/Sun, AIFF, RIFF, SMP, VOC, and so on, plus
  1263. full descriptions of the 2 Sound Designer formats, if you're
  1264. interested.
  1265.  
  1266.  
  1267. /* ------------------------------------ NIST ---------------------------------
  1268.  
  1269.  * 
  1270.  
  1271.  *   0: "NIST_1A"
  1272.  *   8: data_location as ASCII representation of integer
  1273.  *      (apparently always "   1024")
  1274.  *  16: start of complicated header -- full details available upon request
  1275.  *
  1276.  *  here's an example:
  1277.  *
  1278.  *  NIST_1A
  1279.  *     1024
  1280.  *  database_id -s5 TIMIT
  1281.  *  database_version -s3 1.0
  1282.  *  utterance_id -s8 aks0_sa1
  1283.  *  channel_count -i 1
  1284.  *  sample_count -i 63488
  1285.  *  sample_rate -i 16000
  1286.  *  sample_min -i -6967
  1287.  *  sample_max -i 7710
  1288.  *  sample_n_bytes -i 2
  1289.  *  sample_byte_format -s2 01
  1290.  *  sample_sig_bits -i 16
  1291.  *  end_head
  1292.  */
  1293. /* ------------------------------------ SNDT ---------------------------------
  1294.  *
  1295.  * this taken from sndrtool.c (sox-10):
  1296.  *   0: "SOUND"
  1297.  *   6: 0x1a
  1298.  *   8-11: 0
  1299.  *  12-15: nsamples
  1300.  *  16-19: 0
  1301.  *  20-23: nsamples
  1302.  *  24-25: srate
  1303.  *  26-27: 0
  1304.  *  28-29: 10
  1305.  *  30-31: 4
  1306.  *  32-> : <filename> "- File created by Sound Exchange"
  1307.  *  .->95: 0
  1308.  */
  1309. /* ------------------------------------ ESPS ---------------------------------
  1310.  
  1311.  *
  1312.  *   16: 0x00006a1a or 0x1a6a0000
  1313.  *  136: if not 0, chans + format = 32-bit float
  1314.  *  144: if not 0, chans + format = 16-bit linear
  1315.  * 
  1316.  
  1317.  *   from AFgetInfoES.c:
  1318.  * 
  1319.  
  1320.  *       Bytes     Type    Contents
  1321.  *      8 -> 11    --     Header size (bytes)
  1322.  *     12 -> 15    int    Sampled data record size
  1323.  *     16 -> 19    int    File identifier
  1324.  *     40 -> 65    char   File creation date
  1325.  *    124 -> 127   int    Number of samples (may indicate zero)
  1326.  *    132 -> 135   int    Number of doubles in a data record
  1327.  *    136 -> 139   int    Number of floats in a data record
  1328.  *    140 -> 143   int    Number of longs in a data record
  1329.  *    144 -> 147   int    Number of shorts in a data record
  1330.  *    148 -> 151   int    Number of chars in a data record
  1331.  *    160 -> 167   char   User name
  1332.  *    333 -> H-1   --     Generic header items, including "record_freq"
  1333.  *                        {followed by a "double8"}
  1334.  *      H -> ...   --     Audio data
  1335.  */
  1336. /* ------------------------------------ INRS ---------------------------------
  1337.  
  1338.  * 
  1339.  
  1340.  *   from AFgetInfoIN.c:
  1341.  * 
  1342.  
  1343.  *    INRS-Telecommunications audio file:
  1344.  *       Bytes     Type    Contents
  1345.  *      0 ->  3    float  Sampling Frequency (VAX float format)
  1346.  *      6 -> 25    char   Creation time (e.g. Jun 12 16:52:50 1990)
  1347.  *     26 -> 29    int    Number of speech samples in the file
  1348.  *   The data in an INRS-Telecommunications audio file is in 16-bit integer
  1349.  *   format.
  1350.  * 
  1351.  
  1352.  */
  1353. /* old Mus10, SAM formats, just for completeness
  1354.  *
  1355.  * These were used for sound data on the PDP-10s at SAIL and CCRMA in the
  1356.  * 70's and 80's.
  1357.  * The word length was 36-bits.
  1358.  *
  1359.  * "New" format as used by nearly all CCRMA software pre-1990:
  1360.  *
  1361.  *  WD 0 - '525252525252
  1362.  *  WD 1 - Clock rate in Hz (PDP-10 36-bit floating point)
  1363.  *  WD 2 - #samples per word,,pack-code
  1364.  *      (has # samples per word in LH, pack-code in RH)
  1365.  *      0 for 12-bit fixed point
  1366.  *      1 for 18-bit fixed point
  1367.  *      2 for  9-bit floating point incremental
  1368.  *      3 for 36-bit floating point
  1369.  *      4 for 16-bit sambox fixed point, right justified
  1370.  *      5 for 20-bit sambox fixed point
  1371.  *      6 for 20-bit right-adjusted fixed point (sambox SAT format)
  1372.  *      7 for 16-bit fixed point, left justified
  1373.  *      N>9 for N bit bytes in ILDB format
  1374.  *  WD 3 - # channels
  1375.  *      1 for MONO
  1376.  *      2 for STEREO
  1377.  *      4 for QUAD
  1378.  *  WD 4 - Maximum amplitude (if known)
  1379.  *      is a floating point number
  1380.  *      is zero if not known
  1381.  *      is maximum magnitude (abs value) of signal
  1382.  *  WD 5        number of Sambox ticks per pass
  1383.  *              (inverse of Sambox clock rate, sort of)
  1384.  *  WD 6 - Total #samples in file.
  1385.  *         If 0 then #wds_in_file*#samps_per_wd assumed.
  1386.  *  WD 7 - Block size (if any). 0 means sound is not blocked.
  1387.  *  WDs '10-'77 Reserved for EDSND usage
  1388.  *  WDs '100-'177 Text description of file (in ASCIZ format)
  1389.  *
  1390.  *
  1391.  * "Old" format
  1392.  *
  1393.  *  WD 0 - '525252525252
  1394.  *  WD 1 - Clock rate
  1395.  *      has code in LH, actual INTEGER rate in RH
  1396.  *      code=0 for 6.4Kc (or anything else)
  1397.  *          =1 for 12.8Kc, =2 for 25.6Kc, =3 for 51.2Kc
  1398.  *          =5 for 102.4Kc, =6 for 204.8Kc
  1399.  *  WD 2 - pack
  1400.  *      0 for 12 bit
  1401.  *      1 for 16 bit (18 bit)
  1402.  *      2 for 9 bit floating point incremental
  1403.  *      3 for 36-bit floating point
  1404.  *      N>9 for N bit bytes in ILDB format
  1405.  *      has # samples per word in LH.
  1406.  *  WD 3 - # channels
  1407.  *      1 for MONO
  1408.  *      2 for STEREO
  1409.  *      4 for QUAD
  1410.  *  WD 4 - Maximum amplitude (if known)
  1411.  *      is a floating point number
  1412.  *      is zero if not known
  1413.  *      is maximum magnitude (abs value) of signal
  1414.  *  WDs 5-77 Reserved for future expansion
  1415.  *  WDs 100-177 Text description of file (in ASCIZ format)
  1416.  */
  1417.  
  1418. -----------------------------------------------------------------------
  1419. Tandy Deskmate .snd Format Notes
  1420. --------------------------------
  1421.  
  1422. From: Jeffrey L. Hayes <tvdog@delphi.com>
  1423.  
  1424. Tandy .snd files are created by Sound.pdm, a program that came with the 
  1425. proprietary DeskMate environment.  They are used by Music.pdm to create 
  1426. music modules (.sng files).  DeskMate Sound and Music require the Tandy 
  1427. sound chip.  There is a program to convert RIFF WAVE and other 8-bit PCM 
  1428. formats to .snd, Conv2snd, by Kenneth Udut.  Conv2snd v.2.00 comes with 
  1429. Snd2wav, which converts .snd to RIFF WAVE.
  1430.  
  1431. There are two types of DeskMate .snd files, sound files and instrument 
  1432. files.  Both contain 8-bit unsigned PCM samples.
  1433.  
  1434. Sound files are simpler.  These are garden-variety sample files with a 
  1435. fixed-length header giving the name of the sound, the recording frequency, 
  1436. and the length of the sound.  Sound files may be recorded at 5500Hz, 11kHz 
  1437. or 22kHz.
  1438.  
  1439. Instrument files contain samples as well as frequency and looping 
  1440. information used by Music.pdm to represent an instrument.  Instrument files 
  1441. provide for attack, sustain, and decay with several samples having 
  1442. different implied frequencies and being used by Music.pdm to represent the 
  1443. instrument in different pitch ranges.  Up to 16 different notes (with 16 
  1444. different samples) can be contained in one instrument file.  Instrument 
  1445. files are always recorded at 11kHz.  Both sound files and instrument files 
  1446. may be compressed in one of two ways, "music" compression or "speech" 
  1447. compression, or they may be uncompressed.  I don't know the compression 
  1448. algorithms, but simple file comparison reveals that "music" and "speech" 
  1449. compression are almost identical.
  1450.  
  1451. The DeskMate .snd file header consists of 16 bytes of fixed header 
  1452. information followed by one or more 28-byte note records.  The sample 
  1453. information, which may be compressed, follows the header.
  1454.  
  1455. DeskMate .snd File Format - Fixed Header
  1456. ----------------------------------------
  1457.  
  1458.   offset    size      what
  1459.   ------    ----      ----
  1460.  
  1461.   0         byte      1Ah (.snd ID byte)
  1462.  
  1463.   1         byte      Compression code:  0 = no compression; 1 = music
  1464.                       compression; 2 = sound compression.
  1465.  
  1466.   2         byte      Number of notes in the instrument file.  1 if sound
  1467.                       file.
  1468.  
  1469.   3         byte      Instrument number.  0 if sound file; 0FFh if instrument
  1470.                       file with no number set.  Valid instrument numbers in
  1471.                       an instrument file are 1 to 32.  Use this field to
  1472.                       distinguish a sound file from an instrument file.
  1473.  
  1474.   4         10 bytes  Sound or instrument name.  Filled on the right with
  1475.                       nulls if less than 10 characters.
  1476.  
  1477.   0Eh       word      Sampling rate in samples per second.  Note that although
  1478.                       a sampling rate other than 5500, 11000 and 22000 can be
  1479.                       entered here, Sound.pdm will not actually play at other
  1480.                       rates.
  1481.  
  1482.   10h       variable  Note records begin, 28 bytes each.  Number of records
  1483.                       given in byte 2 above.
  1484.  
  1485.  
  1486. DeskMate .snd File Format - Note Record
  1487. ---------------------------------------
  1488.  
  1489.   0         byte      Pitch of the note:  1 = A1 in American Standard Pitch;
  1490.                       2 = A#1; etc.  A1 is lowest note allowed; highest note
  1491.                       allowed is B6 (3Fh).  Sound files have 0FFh here; so do
  1492.                       instrument files with no note set.
  1493.                           Note that Sound.pdm does not designate notes in the
  1494.                       standard manner to the user.  Although A1 and B6 in
  1495.                       Sound.pdm are the same as A1 and B6 in standard pitch,
  1496.                       Sound.pdm starts octaves at A rather than at C (as is
  1497.                       standard).  Thus, middle C, C4 in standard pitch, is C3
  1498.                       in Sound.pdm.
  1499.  
  1500.   1         byte      Sound files, and instrument files with no pitch set,
  1501.                       have 0 here.  If the pitch is set, this byte is 0FFh.
  1502.  
  1503.   2         2 bytes   Range of the note, first byte is lower limit, second
  1504.                       is higher limit.  Byte encoding as for offset 0 (i.e.,
  1505.                       01h to 3Fh).  Sound files have FF FF here; so do
  1506.                       instrument files with no range set.
  1507.  
  1508.   4         dword     Offset in the file where samples for this note begin
  1509.                       (zero-relative), after compression if that was done.
  1510.  
  1511.   8         dword     If compressed, the length of the compressed data in the
  1512.                       file for this note.  Uncompressed files have 0 here.
  1513.  
  1514.   0Ch       4 bytes   Unknown.  Set to zero.
  1515.  
  1516.   10h       dword     Number of samples in the note, after decompression if
  1517.                       necessary.
  1518.  
  1519.   14h       dword     Number of sample at start of sustain region for the
  1520.                       note, relative to the first (zeroth) sample of the note.
  1521.                       For sound files, or if sustain is not set, this field is
  1522.                       0.
  1523.  
  1524.   18h       dword     Number of sample at end of sustain region for the note,
  1525.                       relative to the first (zeroth) sample of the note.  For
  1526.                       sound files, or if sustain is not set, this field is 0.
  1527.  
  1528.